Page({
  goLogin() {
    wx.redirectTo({
      url: '/pages/login/index',
    })
  },
  data: {
    userInfo: {
      avatar: '',
      nickName: ''
    }
  },
  async onShow() {
    const res = await wx.http.get('/userInfo')
    const { avatar, nickName } = res.data.data
    console.log(avatar, nickName);
    this.setData({
      userInfo: { avatar, nickName }
    })

  },

})
